﻿using Architecture.Api.Application.Command.MenuCommand;
using Architecture.Domain;
using Architecture.Domain.Dto;
using Architecture.Service;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.MenuHandler
{
    public class PrivilegeAddCommandHandler : IRequestHandler<PrivilegeAddCommand, int>
    {
        protected readonly IMenuService _menuService;

        public PrivilegeAddCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }

        public async Task<int> Handle(PrivilegeAddCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetRelatedAdd(request.rId,request.mId);
        }

    }
}
